package net.starwifi.duobao.entity;

import com.fasterxml.jackson.annotation.JsonProperty;
import org.hibernate.validator.constraints.NotEmpty;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.Pattern;


/**
 * Entity - Setting.
 *
 * @author ruoo
 * @version 1.0
 */

@Entity
@Table(name = "duob_setting")
@SequenceGenerator(name = "sequenceGenerator", sequenceName = "duob_setting_sequence")
public class Setting extends BaseEntity {

    private static final long serialVersionUID = -67188388306700721L;


    private String code;

    private String configName;

    private String configValue;

    private String configType;

    private String configRange;

    private String description; //描述


    /** 配置CODE,唯一 */
    @JsonProperty
    @NotEmpty(groups = Save.class)
    @Pattern(regexp = "^[0-9a-z_A-Z\\u4e00-\\u9fa5]+$")
    @Column(nullable = false, updatable = false, unique = true, length = 100)
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }


    @NotEmpty
    @Column
    public String getConfigName() {
        return configName;
    }

    public void setConfigName(String configName) {
        this.configName = configName;
    }


    @NotEmpty
    @Column
    public String getConfigValue() {
        return configValue;
    }

    public void setConfigValue(String configValue) {
        this.configValue = configValue;
    }

    @NotEmpty
    @Column
    public String getConfigType() {
        return configType;
    }

    public void setConfigType(String configType) {
        this.configType = configType;
    }

    @Column
    public String getConfigRange() {
        return configRange;
    }

    public void setConfigRange(String configRange) {
        this.configRange = configRange;
    }


    @Column
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }


}